/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * FConstruirMapa.java
 *
 * Created on 20-sep-2011, 23:28:18
 */
package View.Almacen.AdministrarRack;
import java.awt.*;
import java.awt.event.MouseListener;
import javax.swing.*;

/**
 *
 * @author Michael
 */
public class FAdministrarRack extends javax.swing.JFrame {

    int MMapa[][]=null;
    PModificarRack p;
    JScrollPane scrollpane;
    /** Creates new form FConstruirMapa */
    public FAdministrarRack() {
        initComponents();
        setLocationRelativeTo(null);
        
        p = new PModificarRack();        
        scrollpane = new JScrollPane(p);
        this.getContentPane().setLayout (new GridBagLayout());
       
        GridBagConstraints constraints = new GridBagConstraints();
        constraints.gridx = 0; // Columna 0. No necesita estirarse, no ponemos weightx
        constraints.gridy = 0; // Fila 0. Necesita estirarse, hay que poner weighty
        constraints.gridwidth = 1;
        constraints.gridheight =1; 
        constraints.fill = GridBagConstraints.BOTH;
        //constraints.anchor = GridBagConstraints.WEST;
        constraints.weightx = 10.0; // La fila 0 debe estirarse, le ponemos un 1.0
        constraints.weighty = 1.0; // La fila 0 debe estirarse, le ponemos un 1.0
        this.getContentPane().add (scrollpane, constraints); 
        constraints.weightx = 0.0; // La fila 0 debe estirarse, le ponemos un 1.0
        constraints.weighty = 0.0; // Restauramos al valor por defecto, para no afectar a los siguientes componentes.

        POpcionRack panel= new POpcionRack(p,this);
        constraints.gridx = 1; // Columna 2. No necesita estirarse, no ponemos weightx
        constraints.gridy = 0; // Fila 0. Necesita estirarse, hay que poner weighty
        constraints.gridwidth = 1; 
        constraints.gridheight = 1; 
        constraints.fill = GridBagConstraints.BOTH;
        constraints.weightx = 1.0; // La fila 0 debe estirarse, le ponemos un 1.0
        constraints.weighty = 1.0; // La fila 0 debe estirarse, le ponemos un 1.0
    
        this.getContentPane().add (panel, constraints); 
        constraints.weighty = 0.0; // Restauramos al valor por defecto, para no afectar a los siguientes componentes.

        //add(scrollpane);
        //add(new JButton("ala"));
        //add(new JButton("ala"));
        
        //this.getContentPane().add(scrollpane, BorderLayout.CENTER);  
        //p.setSize(100,100);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 703, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 385, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(FAdministrarRack.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(FAdministrarRack.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(FAdministrarRack.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(FAdministrarRack.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new FAdministrarRack().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    // End of variables declaration//GEN-END:variables
}
